package rightsmanagement;

import superkigav.shared.rightsmanagement.ApplicationFunction;
import superkigav.shared.rightsmanagement.UserGroup;
import superkigav.shared.rightsmanagement.UserTicket;

public class Testie {
	public static void main(String[] args) {
		RightsAdministrationService rAS = RightsAdministrationService
				.getRightsAdministrationService();
		UserTicket spass = rAS.authenticate("Peter", "peter123");
		PairUserNameAndPW eins = new PairUserNameAndPW("Peter", "peter123");
		PairUserNameAndPW eins1 = new PairUserNameAndPW("Peter", "peter123");
		System.out.println(eins.equals(eins1));
		if(spass==null) {
			System.err.println("bad");
		}
		System.out.println(spass.toString());
		rAS.addUser("gurken", "salat", new UserGroup(1));
		RightsService rS = new RightsService();
		ApplicationFunction af = new ApplicationFunction();
		af.setFunctionName("Child2Group");
		if((Boolean)rS.isAccessPermitted(spass, af) != null) {
			System.out.println((Boolean)rS.isAccessPermitted(spass, af));
		}
	}
	
}
